From: Jonas Ã…dahl Date: Thu, 15 Dec 2016 11:34:10 +0000 (+0800) Subject: gtk-embed: Don't try to compare with unrealized window X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~608 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c131c44ef64e4d98f1a8d8688cb41078f60c2239;p=gnome-shell.git gtk-embed: Don't try to compare with unrealized window After having embedded a Gtk window, we start to listen for the corresponding MetaWindow to know when it has been mapped by the compositor. If the embedder does not realize the window immediately, and some other window is created and mapped before the embedder realizes the window, we would prior to this patch try to dereference the not created GdkWindow. Fix this by NULL checking the GdkWindow before dereferencing. We will never miss the needed MetaWindow creation since it can not have been mapped have it not yet been realized. https://bugzilla.gnome.org/show_bug.cgi?id=776130 --- diff --git a/src/shell-gtk-embed.c b/src/shell-gtk-embed.c index 3f306136f..176b41320 100644 --- a/src/shell-gtk-embed.c +++ b/src/shell-gtk-embed.c @@ -66,7 +66,7 @@ shell_gtk_embed_window_created_cb (MetaDisplay *display, Window xwindow = meta_window_get_xwindow (window); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (priv->window)); - if (xwindow == gdk_x11_window_get_xid (gdk_window)) + if (gdk_window && xwindow == gdk_x11_window_get_xid (gdk_window)) { ClutterActor *window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));